package com.ichifinga.airwave.shared;

import com.ichifinga.airwave.shared.enums.DisplaySpeeds;
import com.ichifinga.airwave.shared.enums.FlashTypes;
import com.ichifinga.airwave.shared.enums.ScrollTypes;
import com.ichifinga.airwave.shared.enums.ShadeTypes;
import com.ichifinga.airwave.shared.enums.TextShades;
import com.ichifinga.airwave.shared.enums.TextSizes;
import com.ichifinga.airwave.shared.enums.TextWidths;
import com.ichifinga.airwave.shared.enums.Colours;
import com.ichifinga.airwave.shared.entities.Phrase;
import android.content.Context;
import android.content.SharedPreferences;
import com.ichifinga.airwave.shared.entities.*;

public class InitialiseHelper {

	public static void InitialisePhrases(Context context)
	{
		SharedPreferences sharedPreferences;
    	sharedPreferences = context.getSharedPreferences("SharedPreferences", Context.MODE_WORLD_WRITEABLE);
       
    	boolean isInitialised = sharedPreferences.getBoolean("Initialised", false);
    	
    	if(!isInitialised)
    	{
	      	SharedPreferences.Editor editor = sharedPreferences.edit();
	      	editor.clear();
			editor.putBoolean("Initialised", true);
			editor.commit();
			
		  	
			Phrase.SetCurrentPhraseId(context, 1);
			
	    	int phraseId = 1;
	    	
	    	Phrase.SetUpPhrase(context, phraseId,
					"HELLO YOU!", TextSizes.Large, TextWidths.Thick, TextShades.OneColour,
					Colours.Green, Colours.White, Colours.White, Colours.Black,
					ShadeTypes.Gradient, DisplaySpeeds.Normal, ScrollTypes.Scroll, FlashTypes.None);
			
			phraseId ++;
			
			Phrase.SetUpPhrase(context, phraseId,
					"CHILL OUT!", TextSizes.Large, TextWidths.Thin, TextShades.Chill,
					Colours.White, Colours.White, Colours.White, Colours.Black,
					ShadeTypes.Block, DisplaySpeeds.Slow, ScrollTypes.Scroll, FlashTypes.Pulse);
			
			if(!PhraseLibrary.getInstance().getIsLite())
			{
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"DANGER!", TextSizes.Large, TextWidths.Thick, TextShades.Fire,
						Colours.White, Colours.White, Colours.White, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Fit, FlashTypes.Flash);
				    	
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"PANIC!", TextSizes.Large, TextWidths.Normal, TextShades.Ice,
						Colours.White, Colours.White, Colours.White, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Fit, FlashTypes.Strobe);
				
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"HAVE FUN!", TextSizes.Small, TextWidths.Normal, TextShades.Rainbow,
						Colours.White, Colours.White, Colours.White, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Bounce, FlashTypes.None);
				
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"SWIPE TO DISPLAY MORE DOUBLE-TAP TO RESET!", TextSizes.Small, TextWidths.Thick, TextShades.ThreeColour,
						Colours.Black, Colours.Red, Colours.Grey, Colours.White,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Sequence, FlashTypes.None);
				
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"LONG HOLD FOR BACK TO FIRST PHRASE!", TextSizes.Small, TextWidths.Thick, TextShades.ThreeColour,
						Colours.Red, Colours.White, Colours.Blue, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Scroll, FlashTypes.None);
				
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"WOOP!", TextSizes.Large, TextWidths.Thin, TextShades.ThreeColour,
						Colours.Red, Colours.White, Colours.Blue, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.Slow, ScrollTypes.Fit, FlashTypes.Police);
						
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"FAIL", TextSizes.Large, TextWidths.Thin, TextShades.OneColour,
						Colours.White, Colours.White, Colours.Blue, Colours.Black,
						ShadeTypes.Block, DisplaySpeeds.Slow, ScrollTypes.Fit, FlashTypes.Flash);
				
				phraseId ++;
				
				Phrase.SetUpPhrase(context, phraseId,
						"WHY WOULD YOU WANT TO DO THAT", TextSizes.Large, TextWidths.Thin, TextShades.ThreeColour,
						Colours.LightRed, Colours.White, Colours.LightBlue, Colours.Black,
						ShadeTypes.Gradient, DisplaySpeeds.FastIsh, ScrollTypes.SequenceTimed, FlashTypes.None);
			}
    	}
	}
}
